﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace Social_Celebrities
{
  public class ConvertToCapital : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null) return null;
            string ReturnString = string.Empty;
            foreach (string ss in value.ToString().Split(' '))
            {
                ReturnString +=" "+new String(new[] { char.ToUpper(ss.First()) }.Concat(ss.Skip(1)).ToArray());
            }
            return ReturnString; 
        }
       public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }

   public class ConvertToCapital1 : IValueConverter
   {
       public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
       {
           if (System.Convert.ToInt32(value) == 0)
               return "";
           else
               return value;
       }
       public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
       {
           return null;
       }
   }
}